package com.kefu.notice.vo;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.notice.model.BossNoticeInfo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "")
public class BossNoticeInfoSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "标题")
    private String title;
    @ApiModelProperty(value = "创建人")
    private String createId;
    @ApiModelProperty(value = "创建时间开始")
    private Long createTimeStart;
    @ApiModelProperty(value = "创建时间结束")
    private Long createTimeEnd;
    @ApiModelProperty(value = "修改人")
    private String updateId;
    @ApiModelProperty(value = "修改时间开始")
    private Long updateTimeStart;
    @ApiModelProperty(value = "修改时间结束")
    private Long updateTimeEnd;
    @ApiModelProperty(value = "数据状态 0 无效 1有效")
    private Integer dataStatus;
    @ApiModelProperty(value = "发布状态 0 待发布，1 已发布")
    private Integer publishStatus;
    @ApiModelProperty(value = "内容")
    private String content;

	 @Override
    public  LambdaQueryWrapper<BossNoticeInfo> lambdaQuery(){
    	LambdaQueryWrapper<BossNoticeInfo> wrapper=Wrappers.<BossNoticeInfo>lambdaQuery();
	    wrapper.eq(StringUtils.isNotBlank(title), BossNoticeInfo::getTitle, title);
	    wrapper.eq(StringUtils.isNotBlank(createId), BossNoticeInfo::getCreateId, createId);
		wrapper.ge(createTimeStart!=null, BossNoticeInfo::getCreateTime, createTimeStart);
		wrapper.le(createTimeEnd!=null, BossNoticeInfo::getCreateTime, createTimeEnd);
	    wrapper.eq(StringUtils.isNotBlank(updateId), BossNoticeInfo::getUpdateId, updateId);
		wrapper.ge(updateTimeStart!=null, BossNoticeInfo::getUpdateTime, updateTimeStart);
		wrapper.le(updateTimeEnd!=null, BossNoticeInfo::getUpdateTime, updateTimeEnd);
		wrapper.eq(dataStatus!=null, BossNoticeInfo::getDataStatus, dataStatus);
		wrapper.eq(publishStatus!=null, BossNoticeInfo::getPublishStatus, publishStatus);
	    wrapper.eq(StringUtils.isNotBlank(content), BossNoticeInfo::getContent, content);
    	return wrapper;
	}
}